package org.csu.wuliu.service;

import org.csu.wuliu.domain.Supplier;
import org.csu.wuliu.persistence.CategoryMapper;
import org.csu.wuliu.persistence.SupplierMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierService {


    @Autowired
    private SupplierMapper supplierMapper;

    //Supplier相关
    public Supplier getSupplier(String supplierId){
        return supplierMapper.getSupplier(supplierId);
    }

    public boolean issupplierIdExist(String supplierId){
        if(getSupplier(supplierId)==null){
            return false;
        }
        else return true;
    }

    public List<Supplier> getSupplierList(){
        return supplierMapper.getSupplierList();
    }

    public void insertSupplier(Supplier supplier){
        supplierMapper.insertSupplier(supplier);
    }

    public void deleteSupplier(String supplierId){
        supplierMapper.deleteSupplier(supplierId);
    }

    public void updateSupplier(Supplier supplier){
        supplierMapper.updateSupplier(supplier);
    }


}
